package cn.yinuo.website.medicine.service.impl;

import cn.yinuo.website.medicine.entity.Medicine;
import cn.yinuo.website.medicine.mapper.MedicineMapper;
import cn.yinuo.website.medicine.service.IMedicineService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author shiyang
 * @since 2019-05-26
 */
@Service
public class MedicineServiceImpl extends ServiceImpl<MedicineMapper, Medicine> implements IMedicineService {

    @Override
    public Medicine add(Medicine entity) {
        entity.insert();
        return entity;
    }

    @Override
    public Medicine modify(Medicine entity) {
        entity.updateById();
        return entity;
    }

    @Override
    public void delete(String id) {
        deleteById(id);
    }

    @Override
    public Medicine queryById(String id) {
        return selectById(id);
    }
}
